USE [Training]
GO

IF NOT EXISTS (SELECT * from dbo.sysobjects WHERE id = OBJECT_ID(N'dbo.training_api_TrainingRecordUpdate'))
	EXEC('CREATE PROC dbo.training_api_TrainingRecordUpdate AS')
GO

ALTER PROC dbo.training_api_TrainingRecordUpdate
	@TrainingRecordID	int,
	@EmployeeID			int,
	@DueDate			datetime,
	@CompletedDate		datetime = null,
	@SkillID			int
AS
	UPDATE TrainingRecord
	SET
		EmployeeID = @EmployeeID,
		DueDate = @DueDate,
		CompletedDate = @CompletedDate,
		SkillID = @SkillID,
		LastModified = GETDATE()
	WHERE
		TrainingRecordID = @TrainingRecordID

